package bma.shop.web;

import org.springframework.beans.factory.annotation.Autowired;

import bma.shop.web.explorer.ProductExplorerView;
import bma.shop.web.product.ProductContainerView;

import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Window;

@SuppressWarnings("serial")
public class MainPanel extends Window {

	@Autowired
	private ProductContainerView productContainer;
	@Autowired
	private ProductExplorerView productExplorerView;
	
	
	//@Autowired
	//private EventManager eventManager;
	
	public MainPanel() {
		super("My Online Shop");
		
	}
	
	public void init() {
		
		productExplorerView.setHeight("100%");
		productContainer.setHeight("100%");
		
		HorizontalLayout verticalLayout = new HorizontalLayout();
		verticalLayout.setWidth("100%");
		verticalLayout.setHeight("100%");
		verticalLayout.addComponent(productExplorerView);
		verticalLayout.addComponent(productContainer);
		
		
		setContent(verticalLayout);
		//VConsole.log("foo");
		//eventManager.publish(new ApplicationEvents.ApplicationStartEvent());
	}
	
}
